package com.oursnail.service;

import com.oursnail.domain.Comment;
import com.oursnail.repository.CommentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * @Author 【swg】.
 * @Date 2017/12/15 14:03
 * @DESC
 * @CONTACT 317758022@qq.com
 */
@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentRepository commentRepository;
    /* (non-Javadoc)
     * @see com.waylau.spring.boot.blog.service.CommentService#removeComment(java.lang.Long)
     */
    @Override
    @Transactional
    public void removeComment(Long id) {
        commentRepository.delete(id);
    }
    @Override
    public Comment getCommentById(Long id) {
        return commentRepository.findOne(id);
    }

}

